home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 June / macformat-038.iso / Demos / Interactive Wave / _DATAS / SHARED.Dxr / 00974_Gestion des Graphs .ls < prev    next >
Encoding:
Text File  |  1995-08-06  |  3.6 KB  |  153 lines

  1. on PutVisibSprite Para, Chaine
  2.   set Pz to 1
  3.   repeat with AccuA = 0 to length(Chaine) / 3
  4.     set Piste to value(chars(Chaine, Pz, Pz + 1))
  5.     puppetSprite(Piste, 1)
  6.     set the visible of sprite Piste to Para
  7.     set Pz to Pz + 3
  8.   end repeat
  9. end
  10.  
  11. on PutEtatSprite Para, Chaine
  12.   set Pz to 1
  13.   repeat with AccuA = 0 to length(Chaine) / 3
  14.     set Piste to value(chars(Chaine, Pz, Pz + 1))
  15.     puppetSprite(Piste, Para)
  16.     set Pz to Pz + 3
  17.   end repeat
  18. end
  19.  
  20. on FalsePisteTest Piste
  21.   set NumCast to the castNum of sprite Piste
  22.   if NumCast < 1 then
  23.     return 0
  24.   end if
  25.   set TypeCast to the castType of cast NumCast
  26.   if TypeCast = #empty then
  27.     return 0
  28.   end if
  29.   puppetSprite(Piste, 0)
  30.   return 1
  31. end
  32.  
  33. on FalseReste
  34.   repeat with Piste = 1 to 42
  35.     puppetSprite(Piste, 0)
  36.   end repeat
  37.   puppetSprite(47, 0)
  38. end
  39.  
  40. on TrueReste
  41.   repeat with Piste = 1 to 42
  42.     puppetSprite(Piste, 1)
  43.   end repeat
  44. end
  45.  
  46. on ClearPictCast AccuA
  47.   if stringp(AccuA) then
  48.     set AccuA to the number of cast AccuA
  49.   end if
  50.   set AccuC to the picture of cast "N_CastEfface"
  51.   set the picture of cast AccuA to AccuC
  52. end
  53.  
  54. on SetCastSprite Piste, NumCast
  55.   set the castNum of sprite Piste to NumCast
  56. end
  57.  
  58. on SetNomCastSprite Piste, NomCast
  59.   set the castNum of sprite Piste to the number of cast NomCast
  60. end
  61.  
  62. on EffaceSprite NumSprite
  63.   global CastEfface
  64.   set the castNum of sprite NumSprite to CastEfface
  65. end
  66.  
  67. on EffaceText NumSprite
  68.   set the castNum of sprite NumSprite to -1
  69. end
  70.  
  71. on FalseSprBarrette
  72.   global SprFondBar, SprFondBarII, SprBoutBar, SprRollOver
  73.   EffaceTexteRoll()
  74.   EffacePictRoll()
  75.   puppetSprite(SprFondBar, 0)
  76.   puppetSprite(SprFondBarII, 0)
  77.   puppetSprite(SprBoutBar, 0)
  78.   puppetSprite(SprRollOver, 0)
  79.   SetDcBarrette(0)
  80. end
  81.  
  82. on EffaceTexteRoll
  83.   global SprRollOver
  84.   set the castNum of sprite SprRollOver to the number of cast "FondTexteRoll"
  85. end
  86.  
  87. on EffacePictRoll
  88.   global SprBoutBar, CastEfface
  89.   set the castNum of sprite SprBoutBar to CastEfface
  90. end
  91.  
  92. on AnimSprite NumSprite, CastDepart, Periode, Champs
  93.   if stringp(CastDepart) then
  94.     set CastDepart to the number of cast CastDepart
  95.   end if
  96.   repeat with AccuA = 1 to the number of words in Champs
  97.     set the castNum of sprite NumSprite to CastDepart + value(word AccuA of Champs)
  98.     updateStage()
  99.     WaitTicks0(Periode)
  100.   end repeat
  101. end
  102.  
  103. on AnimSpriteCast NumSprite, Periode, Champs
  104.   set listPara to list()
  105.   set LenPara to the number of words in Champs
  106.   repeat with compt = 1 to LenPara
  107.     add(listPara, the number of cast word compt of Champs)
  108.   end repeat
  109.   repeat with compt = 1 to LenPara
  110.     set the castNum of sprite NumSprite to getAt(listPara, compt)
  111.     updateStage()
  112.     WaitTicks0(Periode)
  113.   end repeat
  114. end
  115.  
  116. on PuppetTransit TypeTransit, time, ChunkSize, ChangeArea
  117.   global glQTmemo, DcTransit
  118.   if getAt(glQTmemo, 1) <> 0 then
  119.     exit
  120.   end if
  121.   set DcTransit to 1
  122.   puppetTransition(TypeTransit, time, ChunkSize, ChangeArea)
  123. end
  124.  
  125. on SetTransit AccuA
  126.   global listChampsTransit
  127.   repeat with AccuB = 1 to the number of words in AccuA
  128.     add(listChampsTransit, value(word AccuB of AccuA))
  129.   end repeat
  130. end
  131.  
  132. on SetTransitM AccuA
  133.   global listChampsTransit
  134.   repeat with AccuE = 0 to (the number of words in AccuA - 1) / 2
  135.     set AccuH to (AccuE * 2) + 1
  136.     set AccuG to label(word AccuH of AccuA)
  137.     repeat with AccuF = 0 to value(word AccuH + 1 of AccuA) - 1
  138.       set CC to AccuG + AccuF
  139.       add(listChampsTransit, AccuG + AccuF)
  140.     end repeat
  141.   end repeat
  142. end
  143.  
  144. on InitlistTransit
  145.   global listChampsTransit
  146.   set listChampsTransit to list()
  147. end
  148.  
  149. on GestTransit
  150.   global listChampsTransit, DcTransit
  151.   set DcTransit to getOne(listChampsTransit, the frame) <> 0
  152. end
  153.